for i in range(1,10):
    for k in range(1,10-i):
         print(end="       ")
    for j in range(1,i+1):
        product=i*j
        print("%d*%d=%2d" % (i,j,product),end=" ")
    print('')
print('-'*100)
for i in range(1,10):
    for k in range(1,i):
        print (end="       ")
    for j in range(i,10):
        print("%d*%d=%2d" % (i,j,i*j),end=" ")
    print('')
print('-'*100)
for i in range(1,10):
    for j in range(1,10):
        if i>=j:
            sum=i*j
            print('{}*{}={:<4}'.format(i,j,sum),end='')
    print('')
print('-'*100)
for i in range(1,10):
    for j in range(1,10):
        if i<=j:
            sum=i*j
            print('{}*{}={:<4}'.format(i,j,sum),end='')
    print('')